#ifndef VIEWPORT_H
#define VIEWPORT_H

#include "GeoDefination.h"
#include <QRect>

class ViewPort
{
public:
    ViewPort();
    ViewPort(QRect extent);
    void ZoomIn();
    void ZoomOut();
    void Move(int deltaX, int deltaY);

    QRect getViewPortRect() const;
    void setViewPortRect(const QRect &value);

    int getZoomLevel() const;
    void setZoomLevel(int value);

    GeoExtent getGeoExtent() const;
    void setGeoExtent(const GeoExtent &value);

    QRect getTileIndexRange() const;
    void setTileIndexRange(const QRect &value);

protected:
    void UpdateGeoExtent();
    void UpdateIndexRange();
    void Update();

private:
    GeoPoint centerPt;
    QRect viewPortRect;
    QRect tileIndexRange;
    GeoExtent geoExtent;
    int zoomLevel;
    double resolution;
};

#endif // VIEWPORT_H
